######Video source: https://shop119322454.taobao.com
setwd("E:\\文章\\基于GEO数据集筛选房颤相关lncRNA表达谱和功能鉴定")  #dir
rt=read.table("input.txt", header=T, sep="\t", comment.char = "", check.names =FALSE)
tb=table(c(as.vector(rt[,1]),as.vector(rt[,2])))
tb=sort(tb,decreasing =T)
write.table(tb,file="count.xls",sep="\t",quote=F,col.names=F)

n=as.matrix(tb)[1:15,]   #gene number
pdf(file="barplot.pdf")
par(mar=c(3,10,3,3),xpd=T)
bar=barplot(n,horiz=TRUE,col="skyblue",names=FALSE)
text(x=n-1,y=bar,n)
text(x=-3,y=bar,label=names(n),xpd=T)
dev.off()
